package com.starlink.model.util;

import com.starlink.model.dtomapper.UserDtoMapper;
import com.starlink.model.domain.UserDO;
import com.starlink.model.vo.UserVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class UserConvert {

    public static List<UserVO> buildUserVoList(List<UserDO> userDOList) {
        if (CollectionUtils.isEmpty(userDOList)) {
            return Lists.newArrayList();
        }
        List<UserVO> userVOList = new ArrayList<>();
        for (UserDO userDO : userDOList) {
            userVOList.add(UserDtoMapper.INSTANCE.do2VO(userDO));
        }

        return userVOList;
    }
}
